-quick_result ||= nil
-if @root_categories.empty?
  .no-results
    No results found
-else
  .action-items.action-below
    %a{ :href => export_flow_categories_path(:format => :csv) }
      %i.grcicon-export
      Export
  %ul.tree-structure
    -@root_categories.sort_by(&:display_name).each do |root_category|
      -if quick_result
        =render 'base_objects/quick_result', { :item => root_category }
        -root_category.descendants.sort_by(&:display_name).each do |category|
          =render 'base_objects/quick_result', { :item => category }
      -else
        %li
          .item-main
            .openclose
            .item-title
              .row-fluid
                .span12
                  .oneline
                    %span.title
                      =root_category.display_name
              .item-actions
                %a.btn.btn-mini{ :'data-form-target' => "refresh", :'data-delete-target' => "refresh", :'data-modal-reset' => "reset", :'data-toggle' => "modal-ajax-form", :href => edit_flow_category_path(root_category) }
                  %i.grcicon-edit
                
          .item-content
            %ul.tree-structure
              -root_category.descendants.sort_by(&:display_name).each do |category|
                %li
                  .item-main
                    .item-title
                      .row-fluid
                        .span12
                          .oneline
                            %span.title
                              =category.display_name
                      .item-actions
                        %a.btn.btn-mini{ :'data-form-target' => "refresh", :'data-delete-target' => "refresh", :'data-modal-reset' => "reset", :'data-toggle' => "modal-ajax-form", :href => edit_flow_category_path(category) }
                          %i.grcicon-edit
        -#-root_category.descendants.sort_by(&:display_name).each do |category|
          -# TODO: Predrag said to use inline style for now. Ref. story: #40581877
          %li
            %a.widgetbtn.fltrt{ :'data-form-target' => "refresh", :'data-delete-target' => "refresh", :'data-modal-reset' => "reset", :'data-toggle' => "modal-ajax-form", :href => edit_flow_category_path(category) }
              %i.grcicon-edit
            =link_to '#' do
              =category.display_name
